<%--
  Created by IntelliJ IDEA.
  User: 22179
  Date: 2025/3/4
  Time: 19:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/index_work.css">
    <title>Title</title>
    <style>
        table{
            border: 1px solid black;
            width: 800px;
            border-collapse: collapse;
            cellpadding:"0px" ;
            cellspacing:"0px";
        }
        table td, table th { /* 给所有的td和th加上边框 */
            border: 1px solid black;
            padding: 5px; /* 可以根据需要调整 */
        }
    </style>
</head>
<body>
    <button onclick="back()">返回图书列表</button>
        <table>
                <tr>
                    <td>编号</td>
                    <td>用户名</td>
                    <td>图书名</td>
                    <td>借书时间</td>
                    <td>还书时间</td>
                    <td>操作</td>
                </tr>

            <c:forEach var="jbook" items="${list}">
                <tr>
                    <td>${jbook.id}</td>
                    <td>${jbook.user.name}</td>
                    <td>${jbook.book.name}</td>
                    <td>${jbook.jdate}</td>
                    <td>${jbook.hdate}</td>
                    <td>
                        <button onclick="upjbook(${jbook.id},${jbook.uid},${jbook.bid})">还书</button>
                    </td>
                </tr>
            </c:forEach>
        </table>
<script>
    function back() {
        location.href="/Book?method=getuserlist";
    }
    function upjbook(id,uid,bid) {
            location.href="/Book?method=upjlist&id="+id+"&uid="+uid+"&bid="+bid;


    }
</script>

</body>
</html>
